package com.wwmz.proxy.pattern.dbroute;

import com.wwmz.proxy.pattern.dbroute.staticproxy.OrderServiceStaticProxy;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by wumz on 2020/9/21 11:08
 */
public class Test {
    public static void main(String[] args) {
        try {
            Order order = new Order();
//            order.setCreateTime(new Date().getTime());
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");
            Date date = sdf.parse("2020/03/01");
            order.setCreateTime(date.getTime());
//            IOrderService orderService = (IOrderService)new OrderServiceDynamicProxy().getInstance(new OrderService());
            IOrderService orderService = (IOrderService)new OrderServiceStaticProxy(new OrderService());
            orderService.createOrder(order);
        }catch (Exception e){
            e.printStackTrace();
        }

    }
}
